<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="wrapper">
      <div class="box">1</div>
      <div class="box">2</div>
      <div class="box">3</div>
      <div class="box">4</div>
    </div>
    <script>
      var wrapper = document.getElementById('wrapper');
      var box = document.querySelectorAll('.box');
      var boxClass = document.getElementsByClassName('box');
      console.log(box);
      console.log(boxClass);
      // box.length = 2;
      // boxClass.length = 2;
      wrapper.removeChild(wrapper.box[3]);
      console.log(box);
      console.log(boxClass);
    </script>
  </body>
</html>
